document.getElementById('loginForm').addEventListener('submit', function(event) {
    event.preventDefault();
    const username = document.getElementById('username').value.trim();
    const password = document.getElementById('password').value.trim();

    if (!username || !password) {
        alert('用户名和密码不能为空！');
        return;
    }

    // 模拟登录成功跳转
    alert('登录成功！正在跳转至主页...');
    window.location.href = 'index.html';
});